package terra.network;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import terra.network.packet.Packet;

public class Connections {

	public static Map<Integer, PlayerHandler> connections = new ConcurrentHashMap<Integer, PlayerHandler>();

	public static void broadcast(Packet p) {
		if (p == null || connections.size() == 0)
			return;
		for (PlayerHandler ph : connections.values()) {
			if (ph.getPlayer() != null)
			ph.send(p);
		}
	}
}
